package com.lagou.service.impl;

import com.lagou.dao.ArticleDao;
import com.lagou.domain.Article;
import com.lagou.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service //生成该类的实例存入IOC容器中
public class ArticleServiceImpl implements ArticleService {

    //ArticleDao注入
    @Autowired
    private ArticleDao articleDao;

    /**
     * 切入点 添加上事务控制的效果
     * @param article
     */
    public void sava(Article article) {

        System.out.println("haha");    
        articleDao.sava(article);

        //进行异常
        //int i = 1/0;
    }
}
